Use shared AdbRunner from android-tools for device listing#10880
Closed
Use shared AdbRunner from android-tools for device listing#10880
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Delegates the
adb devices -lparsing, description building, and device/emulator merging logic from theGetAvailableAndroidDevicesMSBuild task to the sharedAdbRunnerinXamarin.Android.Tools.AndroidSdk(via theexternal/xamarin-android-toolssubmodule).This removes ~200 lines of duplicated parsing/formatting/merging code from dotnet/android and consolidates it in the shared android-tools library where it can be reused by other consumers (e.g., the MAUI DevTools CLI).
Changes
external/xamarin-android-toolsbumped tob4da013(main branch). Includes:ParseAdbDevicesOutput,BuildDeviceDescription,MergeDevicesAndEmulators,FormatDisplayNameAcceptLicensesAsynccurrently causes build failures. Fix is in android-tools [aot] Rework construction and logging of AOT command #298. Once [aot] Rework construction and logging of AOT command #298 merges, submodule needs bumping again.AdbRunner.ParseAdbDevicesOutput(IEnumerable<string>),AdbRunner.BuildDeviceDescription, andAdbRunner.MergeDevicesAndEmulatorsinstead of having its own parsing logic. AddedConvertToTaskItemsto bridgeAdbDeviceInfo->ITaskItem.AdbRunner/AdbDeviceInfodirectly instead of reflection. All tests preserved with equivalent coverage.Commits (3)
20af13558— Bump xamarin-android-tools tob4da013(FormatDisplayName fix)8d6881750— Use shared AdbRunner from android-tools for device listing38f202f88— Update GetAvailableAndroidDevices.cs (hoistCreateTaskLogger()out of loop per @jonathanpeppers)Review Feedback Addressed
ParseAdbDevicesOutputshould takeIEnumerable<string>string.JoinallocationAction<TraceLevel, string>logger parameterCreateTaskLogger()out of loop38f202f88CI Status
Currently failing on all 3 platforms (Linux, macOS, Windows) with RS0026 errors from the PublicAPI analyzer in the submodule. Blocked on android-tools #298 which splits
AcceptLicensesAsyncoverloads to eliminate optional-parameter ambiguity.Dependencies